2 ############################################################
4 # author: devenkong(18151155@qq.com)
6 ############################################################
7 # Copyright (C) 2022- Free Software Foundation, Inc.
8 # This configure script is free software; the Free Software
9 # Foundation gives unlimited permission to copy, distribute
11 ############################################################
13 # this is a testing script for debugging based on output
14 # txt strings. it helps programer to find out code file and
15 # lines which output error info.
16 ############################################################
27 ##############################
28 # section: shlib include
29 ##############################
35 ##############################
36 # section: public comment info
37 ##############################
42 ##############################
43 # section: variable define
44 ##############################
46 longstr
="adhdhjdjfjfjdjdjd
53 fkkforoeoeidjchshhsejj
57 ##############################
58 # section: private function
59 ##############################
64 # here is the example for stub debug
65 # use stub string to seperate application string info,
66 # if some of the code running error, it shows error code where it
70 dbgout
"xxxxxxxxxxxx step1 xxxxxxxxxxxx\n"
73 dbgout
"xxxxxxxxxxxx step2 xxxxxxxxxxxx\n"
76 dbgout
"xxxxxxxxxxxx step3 xxxxxxxxxxxx\n"
79 dbgout
"xxxxxxxxxxxx step4 xxxxxxxxxxxx\n"
82 dbgout
"xxxxxxxxxxxx step5 xxxxxxxxxxxx\n"
85 dbgout
"xxxxxxxxxxxx step6 xxxxxxxxxxxx\n"
91 # using stub to locate in src code
92 # it can be used for branch structure code.
98 echo application string output.
101 # display invoke stack to get the code location.
108 ##############################
109 # section: public function
110 ##############################
119 echo "func-paramter:"
121 init_dbglogout
2 shlibopt
20000
123 info
"this example shows how to use debug infomation output function in sub-process of while loop."
125 echo xxxxxxxxxxxxxxxxxxxxxxxxx
127 echo testvar
=$testvar
130 # use dbgoutvar to display long string by var name.
135 # display data as hex string.
137 echo dbgout_hex | dbgout_hex
142 [[ $cnt == 5 ]] && break
147 # output string on debug channel
152 # debug pause as a single step
156 info testvar
=$testvar
158 echo "echo string in logfile."
159 dbgout
"output debug string here.\n"
160 info
"output info string on tty console."
161 done < <(cat sceipts
/data.txt
) > output.txt
163 echo at last
, cnt
=$cnt
167 echo xxxxxxxxxxxxxxxxxxxxxxxxx
173 ##############################
175 ##############################